﻿
@{
    Layout = null;
}

<form id="nameForm" action="/name/" method="post">
    <input id="filterByName" placeholder="Pretraga po imenu..." name="name" type="text" />
    <input type="hidden" value="Pretraga po nazivu" />
</form>
<script type="text/javascript">
    $(function () {
        $("#filterByName").autocomplete({
            source: "/Event/GetEventTitles",
            minLength:2,
            select: function (event, ui) {
                if (ui.item) {
                    $("#filterByName").val(ui.item.value);
                    $("#nameForm").submit();
                }
            }
        });
    });
</script>